<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/8
 * Time: 16:40
 */

$userKey = $_COOKIE['userID'];

session_start();

if (isset($_SESSION[$userKey]['username'])){
    echo '欢迎您：'.$_SESSION[$userKey]['username'].'<br><br>';
}else{
    echo '你尚未登入，<a href=\'/Shop/login.php\'>请登入</a>';
    die;
}
$imgUrl ='../public/img/'.$_GET['temp'];
?>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
    <a href="changePwd_page.php"><button type="button">修改密码</button></a>
    <p>头像：<img src="<?php echo $imgUrl;?>"></p>
    <form action="img.php" method="post" enctype="multipart/form-data">
        <input type="file" name="file">
        <br/>
        <button type="submit">上传头像</button>
    </form>
</body>

</html>
